package cn.zhuo.knowledge.util.hutool.net.url;

import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

/**
 * <p>
 *
 * @author z2huo
 */
public class UrlJavaTest {

    public static void main(String[] args) {
        System.out.println(URLEncoder.encode(" ", StandardCharsets.UTF_8));
        System.out.println(URLEncoder.encode("+", StandardCharsets.UTF_8));

        System.out.println(URLDecoder.decode(" ", StandardCharsets.UTF_8) + "===");
        System.out.println(URLDecoder.decode("+", StandardCharsets.UTF_8) + "===");
        System.out.println(URLDecoder.decode("%20", StandardCharsets.UTF_8) + "===");
        System.out.println(URLDecoder.decode("%2B", StandardCharsets.UTF_8) + "===");
    }
}
